const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')

const IS_PRODUCTION = process.env.NODE_ENV === 'production'
const plugins = [
  new CopyWebpackPlugin([
    {
      from: path.join(__dirname, 'src/wxcomponents/custom-tab-bar'),
      to: path.join(__dirname, 'dist', IS_PRODUCTION ? 'build' : 'dev', process.env.UNI_PLATFORM, 'custom-tab-bar')
    }
  ])
]
module.exports = {
  configureWebpack: {
    plugins: process.env.UNI_PLATFORM === 'mp-weixin' ? plugins : []
  },
  transpileDependencies: ['mescroll-uni', 'tki-qrcode'],
  lintOnSave: false
}
